﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SistemaBastanteo.Dominio;
using NHibernate;

namespace SistemaBastanteo.Persistencia.NH
{
    public class ClienteDAO : BaseDAO<Cliente, int>, IClienteDAO
    {
        public ICollection<Cliente> ObtenerClientePorRUC(string ruc)
        {
            using (ISession sesion = NHibernateHelper.ObtenerSesion())
            {
                IQuery query = sesion.CreateQuery("FROM Cliente WHERE ruc = '" + ruc + "'");
                return query.List<Cliente>();
            }
        }
    }
}